<!-- necesita :local=>{ :instructor=>XXX } -->
<%alus_sin_plan=instructor.alumnos.find(:all, :conditions=>"NOT EXISTS ( SELECT * FROM plans WHERE personas.id=plans.alumno_id AND plans.ini<=CURDATE() AND plans.fin>=CURDATE() )")%>
<table class="side_bar_table">
	<%if current_user.instructor == instructor%>
		<tr><th colspan="2">Tus alumnos sin Plan vigente</th></tr>
	<%else%>
		<tr><th colspan="2">Alumnos de <%=h instructor.nombre%> sin Plan vigente</th></tr>
	<%end%>
	<%if alus_sin_plan.length>0%>
		<%n=0%>
		<%for alumno in alus_sin_plan%>
		<%n+=1%>
			<tr class="row<%=n%2%>">
				<td><%= link_to h(alumno.nombre_completo), :action=>'pre_show', :controller=>'personas', :id=>alumno%></td>
				<td><%= link_to "+plan", :controller=>'plans', :action=>'new', :plan_alumno=>alumno.id %></td>
			</tr>
			
		<%end%>
	<%else%>
		<tr><td colspan="2">ninguno</td></tr>
	<%end%>
</table>